var express = require('express');
var {expressjwt}=require('express-jwt')
var app = express()
app.use(express.static('static'))

app.use(express.json())
app.use(express.urlencoded({ extended: false }))

app.use( expressjwt({
  secret: '1234' ,
  algorithms: ['HS256'], 
}).unless( { path:['/user/login','/user/register'] } ) );

var userRouter=require('./router/userrouter')

app.use('/user',userRouter)

app.listen(8084, () => {
  console.log('服务端运行在:http://localhost:8084');
})

